package com.zkc.blog.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 拦截器配置类
 * @author Administrator
 *
 */
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter{

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/admin/**")//admin路径下都触发LoginInterceptor拦截器
		.excludePathPatterns("/admin/loginPage")				//不拦截的路径
		.excludePathPatterns("/admin/login");
		
		super.addInterceptors(registry);
	}

	

}
